<?php

use think\migration\Seeder;

class CompanyIndustryMonitorCommonMinuteData extends Seeder
{

    public function run()
    {
        $table = $this->table('company_industry_monitor_common_minute');
        //1脱硝1
        $rows[0] = [
            // step1:发布时间
            'publish_time'            => date('Y-m-d H:i', time()).':00',
            'publish_type'            => 'N',

            //step2:相关ID和名称
            'region_id'               => '53',
            'industry_id'             => '1',
            'industry_name'           => '电力供热',
            'company_id'              => '1',
            'company_name'            => '晋能长治热电有限公司',
            'drain_id'                => '1',
            'drain_name'              => '1#',
            'facility_id'             => '1',
            'facility_number'         => '1-123456',

            //step3:运行参数
            'operation_concentration' => mt_rand(100, 300),
            'operating_efficiency'    => mt_rand(10, 90),

            //step4:时间
            'create_time'             => date('Y-m-d H:i:s', time()),
        ];
        //1脱硝2
        $rows[1] = [
            // step1:发布时间
            'publish_time'            => date('Y-m-d H:i', time()).':00',
            'publish_type'            => 'N',

            //step2:相关ID和名称
            'region_id'               => '53',
            'industry_id'             => '1',
            'industry_name'           => '电力供热',
            'company_id'              => '1',
            'company_name'            => '晋能长治热电有限公司',
            'drain_id'                => '1',
            'drain_name'              => '1#',
            'facility_id'             => '2',
            'facility_number'         => '1-234567',

            //step3:运行参数
            'operation_concentration' => mt_rand(100, 300),
            'operating_efficiency'    => mt_rand(10, 90),

            //step4:时间
            'create_time'             => date('Y-m-d H:i:s', time()),
        ];
        //2脱硫
        $rows[2] = [
            // step1:发布时间
            'publish_time'            => date('Y-m-d H:i', time()).':00',
            'publish_type'            => 'S',

            //step2:相关ID和名称
            'region_id'               => '53',
            'industry_id'             => '1',
            'industry_name'           => '电力供热',
            'company_id'              => '1',
            'company_name'            => '晋能长治热电有限公司',
            'drain_id'                => '1',
            'drain_name'              => '1#',
            'facility_id'             => '3',
            'facility_number'         => '1-345678',

            //step3:运行参数
            'operation_concentration' => mt_rand(100, 300),
            'operating_efficiency'    => mt_rand(10, 90),

            //step4:时间
            'create_time'             => date('Y-m-d H:i:s', time()),
        ];

        $table->insert($rows)->save();
    }
}